<!--
Copyright 2017 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<kd-content-card>
  <kd-title>[[Allocated resources|Label 'Allocated resources' for the allocated resources section.]]</kd-title>
  <kd-content>
    <div class="kd-allocated-resources">
      <div class="kd-graph-container">
        <kd-allocated-resources-chart outer="$ctrl.allocatedResources.cpuRequestsFraction"
                                      inner="$ctrl.allocatedResources.cpuLimitsFraction">
        </kd-allocated-resources-chart>
        <div class="kd-graph-legend">
          <div class="kd-graph-legend-title">
            CPU allocation (cores)
          </div>
          <div class="kd-graph-legend-entry">
            <md-icon class="kd-graph-running">stop</md-icon>
            [[Requests|Label 'Requests' for the allocated resources graphs legend.]]
            <span class="kd-graph-legend-value">
              {{$ctrl.allocatedResources.cpuRequests | kdCores}}
            </span>
          </div>
          <div class="kd-graph-legend-entry">
            <md-icon class="kd-graph-blue">stop</md-icon>
            [[Limits|Label 'Limits' for the allocated resources graphs legend.]]
            <span class="kd-graph-legend-value">
              {{$ctrl.allocatedResources.cpuLimits | kdCores}}
            </span>
          </div>
          <div class="kd-graph-legend-entry">
            <div class="kd-graph-legend-placeholder"></div>
            [[Capacity|Label 'Capacity' for the allocated resources graphs legend.]]
            <span class="kd-graph-legend-value">
              {{$ctrl.allocatedResources.cpuCapacity | kdCores}}
            </span>
          </div>
        </div>
      </div>
      <div class="kd-graph-container">
        <kd-allocated-resources-chart outer="$ctrl.allocatedResources.memoryRequestsFraction"
                                      inner="$ctrl.allocatedResources.memoryLimitsFraction">
        </kd-allocated-resources-chart>
        <div class="kd-graph-legend">
          <div class="kd-graph-legend-title">
            Memory allocation (bytes)
          </div>
          <div class="kd-graph-legend-entry">
            <md-icon class="kd-graph-running">stop</md-icon>
            [[Requests|Label 'Requests' for the allocated resources graphs legend.]]
            <span class="kd-graph-legend-value">
            {{$ctrl.allocatedResources.memoryRequests | kdMemory}}
            </span>
          </div>
          <div class="kd-graph-legend-entry">
            <md-icon class="kd-graph-blue">stop</md-icon>
            [[Limits|Label 'Limits' for the allocated resources graphs legend.]]
            <span class="kd-graph-legend-value">
            {{$ctrl.allocatedResources.memoryLimits | kdMemory}}
            </span>
          </div>
          <div class="kd-graph-legend-entry">
            <div class="kd-graph-legend-placeholder"></div>
            [[Capacity|Label 'Capacity' for the allocated resources graphs legend.]]
            <span class="kd-graph-legend-value">
            {{$ctrl.allocatedResources.memoryCapacity | kdMemory}}
            </span>
          </div>
        </div>
      </div>
      <div class="kd-graph-container">
        <kd-allocated-resources-chart outer="$ctrl.allocatedResources.podFraction">
        </kd-allocated-resources-chart>
        <div class="kd-graph-legend">
          <div class="kd-graph-legend-title">
            Pods allocation
          </div>
          <div class="kd-graph-legend-entry">
            <md-icon class="kd-graph-running">stop</md-icon>
            [[Allocation|Label 'Allocation' for the allocated resources graphs legend.]]
            <span class="kd-graph-legend-value">
            {{$ctrl.allocatedResources.allocatedPods}}
            </span>
          </div>
          <div class="kd-graph-legend-entry">
            <div class="kd-graph-legend-placeholder"></div>
            [[Capacity|Label 'Capacity' for the allocated resources graphs legend.]]
            <span class="kd-graph-legend-value">
            {{$ctrl.allocatedResources.podCapacity}}
            </span>
          </div>
        </div>
      </div>
    </div>
  </kd-content>
</kd-content-card>
